<template>
	<view>
        <view class="u-page" v-if="listPageConfig">
            <commonListPage :config="listPageConfig"></commonListPage>
        </view>
        <mytabbar></mytabbar>
	</view>
</template>

<script>
	import mytabbar from '@/components/tabbar/index.vue';
    import commonListPage from '@/components/commonListPage/commonListPage.vue';
	export default {
		components: {
            mytabbar: mytabbar,
            commonListPage: commonListPage
        },
		data() {
			return {
				listPageConfig: ''
			}
		},
		onLoad(options) {
			this.pageOptions = options;
            this.doWxLogin().then(res => {
                this.openId = res.openId;
				this.initConfig();
            })
		},
		options: { styleIsolation: 'shared' },
		methods: {
			initConfig() {
				var vm = this;
				// 默认读取 文档库的配置
				var loadJSON = vm.pageOptions.loadJSON || '/mobile/mpoa/content/config.json';
				vm.getAndLoad('获取列表页配置', loadJSON, function (data) {
					vm.listPageConfig = data;
				});
			}
		}
	}
</script>

<style lang="scss" scoped>
</style>

